package studentmanage.service.impl;

import studentmanage.entity.Students;
import studentmanage.mapper.StudentMapper;
import studentmanage.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    public List<Students> selectAllStudent(){

        List<Students> list = studentMapper.selectAllStudent();
        if (list==null){
            log.info("list{}",list);
        }
        return list;
    }

    public void addStudent(Students students){
        studentMapper.addStudent(students);
    }
    public void deleteStudent(long studentId){
        studentMapper.deleteStudent(studentId);
    }
    public void updateStudent(Students students){
        studentMapper.updateStudent(students);
    }
}
